<template>
    <div class="platform-upload">
        <!-- 导航栏 -->
        <NavBar :navBarItem="navBarData" @clickBarItem="clickBarItem" :style="isNavBarShow ? '' : 'display: none;'">
        </NavBar>
        <router-view @changeNavBarShow="changeNavBarShow"></router-view>
    </div>
</template>

<script setup>
import NavBar from '@/components/navbar/NavBar.vue';
import { ref } from 'vue';
import { useStore } from 'vuex';
import { useRoute, useRouter } from 'vue-router';

const route = useRoute();
const router = useRouter();

const isNavBarShow = ref(true);
const navBarData = ref([
    { name: "视频投稿", path: '/platform/upload/video' },
    { name: "专栏投稿", path: '/platform/upload/text' },
]);

const clickBarItem = (path) => {
    if (path !== route.path) {
        router.push(path);
    }
};

const changeNavBarShow = (flag) => {
    isNavBarShow.value = flag;
};

</script>

<style scoped></style>